package com.whut.cristiano.autographbook;

import android.app.Application;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;

import com.android.volley.RequestQueue;
import com.android.volley.toolbox.Volley;

/**
 * Created by ykbboom on 2017/4/5 17:53
 * email：ykbpro@whut.edu.cn
 */

public class MyApplication extends Application {
    private static Context mContext;
    private static RequestQueue requestQueue;
    private static SharedPreferences sharedPreferences;
    private static SharedPreferences.Editor editor;

    @Override
    public void onCreate() {
        mContext = getApplicationContext();
        requestQueue = Volley.newRequestQueue(mContext);
        sharedPreferences = PreferenceManager.getDefaultSharedPreferences(mContext);
        editor = sharedPreferences.edit();
        super.onCreate();
    }
    public static Context getContext(){
        return mContext;
    }
    public static RequestQueue getRequestQueue(){
        return requestQueue;
    }
    public static SharedPreferences getSharedPreferences(){return sharedPreferences;}
    public static SharedPreferences.Editor getEditor(){return editor;}

}
